'use strict';

/* App Module */

var app = angular.module('app', [
    'ngRoute',
    'ydylControllers',
    'ydylServices'
]);
var appRoutes = [
    {name: 'Login', status: 'done'},
    {name: 'Register', status: 'done'},
    {name: 'Forget', status: 'done'},
    {name: 'MemberCenter', status: 'done'},
    {name: 'Authentication', status: 'done'},
    {name: 'Coupon', status: 'DELETE'},
    {name: 'JoinMember', status: 'done'},
    {name: 'ExpertList', status: 'done'},
    {name: 'ExpertHome', status: 'done', params:'?mobile=15899993333'},
    {name: 'EnquireStart', status: 'done', params:'?mobile=15899993333'},
    {name: 'Enquiring', status: ''},
    {name: 'Enquire', status: ''},
    {name: 'EnquiringWait', status: ''},
    {name: 'EnquiringFinish', status: ''},
    {name: 'EnquiringUnpay', status: ''},
    {name: 'EnquiringProfile', status: 'done', params:'?id=14'},
    {name: 'EnquiringCancel', status: 'done'},
    {name: 'ExpertChoose', status: 'done'},
    {name: 'EnquireChat', status: ''},
    {name: 'Pay', status: ''},
    {name: 'OrderToMe', status: 'done'},
    {name: 'OrderFromMe', status: 'done'},
    {name: 'OrderStatus', status: ''},
    {name: 'PointDetails', status: 'done'},
    {name: 'YxjtList', status: ''},
    {name: 'ZbjtPlaying', status: ''},
    {name: 'PayForAnother', status: ''},
    {name:'DiagnosisList', status:''},
    {name:'MemberProfile', status:''},
    {name:'Dicom', status:''}
];


app.config(['$routeProvider','$locationProvider',
    function($routeProvider, $locationProvider) {
        //$locationProvider.html5Mode(true);

        var route = $routeProvider
            .when('/', {
                templateUrl: 'partials/Index.html',
                controller: 'IndexController'
            });

        for(var i in  appRoutes){
            var routeName = appRoutes[i].name;
            route = route.when('/' + routeName, {
                templateUrl: 'partials/' + routeName + '.html',
                controller: routeName + 'Controller'
            });
        }
        route.otherwise({
            redirectTo: '/'
        });
    }]);
